﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
namespace InsuranceSell.Code.Data
{
    public static class Encryptor
    {
        public static string HashMD5(string inputString)
        {
            Byte[] originalBytes;
            Byte[] encodedBytes;
            MD5 md5;

            md5 = new MD5CryptoServiceProvider();
            originalBytes = ASCIIEncoding.Default.GetBytes(inputString);
            encodedBytes = md5.ComputeHash(originalBytes);

            return BitConverter.ToString(encodedBytes);


            //UTF32Encoding u = new UTF32Encoding();
            //byte[] bytes = u.GetBytes(inputString);
            //MD5 md = new MD5CryptoServiceProvider();
            //byte[] result = md.ComputeHash(bytes);
            //return Convert.ToBase64String(result);
            //return inputString;
            
        }
    }
}
